﻿Public Class DueñoNegocio

    Public Function insertarDueño(ByVal Nombres As String, ByVal ApellidoP As String, ByVal ApellidoM As String, ByVal Correo As String, ByVal Clave As String, ByVal Telefono As Integer, ByVal Direccion As String, ByVal DNI As Integer) As Dueño

        Dim modelo As New Dueño()

        modelo.Nombres = Nombres
        modelo.ApellidoP = ApellidoP
        modelo.ApellidoM = ApellidoM
        modelo.Correo = Correo
        modelo.Clave = Clave
        modelo.Telefono = Telefono
        modelo.Direccion = Direccion
        modelo.DNI = DNI

        Dim dao As New DueñoDAO
        Try
            Return dao.insertar(modelo)
        Catch ex As Exception
            Throw ex
        End Try


    End Function

    Public Sub actualizar(ByVal idDueño As Integer, ByVal Nombres As String, ByVal ApellidoP As String, ByVal ApellidoM As String, ByVal Correo As String, ByVal Clave As String, ByVal Telefono As Integer, ByVal Direccion As String, ByVal DNI As Integer)


        Dim modelo As New Dueño()

        modelo.idDueño = idDueño
        modelo.Nombres = Nombres
        modelo.ApellidoP = ApellidoP
        modelo.ApellidoM = ApellidoM
        modelo.Correo = Correo
        modelo.Clave = Clave
        modelo.Telefono = Telefono
        modelo.Direccion = Direccion
        modelo.DNI = DNI


        Dim dao As New DueñoDAO
        dao.actualizar(modelo)
    End Sub


    Public Function buscarPorNombre(ByVal apellidoP As String) As Collection
        Dim dao As New DueñoDAO
        Return dao.buscarPorNombre(apellidoP)
    End Function



    Public Function obtener(ByVal apellidoP As Integer) As Dueño
        Dim dao As New DueñoDAO
        Return dao.obtener(apellidoP)
    End Function

End Class

